<template>
  <div class="hello">
    <div class="header">
      <div class="headl">
        <router-link tag="span" to="/control/login/login" ><!-- v-if="!is_login" -->
          <span class="iconfont icon-touxiang"></span>
          <span>登录</span>
        </router-link>
        <!-- <a v-else>
          <span clss="username">{{username}}</span>
          <span @click="zhuxiao"></span>
        </a> -->
      </div>
      <div class="headr">
        <router-link tag="span" to="/control/set" >
        <span class="iconfont icon-setting"></span>
        </router-link>
      </div>
    </div>
    <div class="yingnew">
      <div class="headl">
        <span>应用更新</span>
        <span>3</span>
      </div>
      <div class="headr">
        <div v-for="(item,id) of cun_list" :key="id">
          <img :src="item.src" alt class="imgs" />
        </div>
        <span>等应用有更新</span>
      </div>
    </div>
    <div class="toolbox">
      <div class="tool" align="center">
        <div v-for="(item,id) of icons_list" :key="id">
          <span :class="icon(item.icon)"></span>
          <p>{{item.textp}}</p>
        </div>
      </div>
    </div>
    <div class="p1">第三方服务</div>
    <div class="tobt">
      <div align="center">
        <span class="iconfont icon-computer"></span>
        <p>视频交友</p>
      </div>
      <div align="center">
        <span class="iconfont icon-mianliuliangfuwu"></span>
        <p>免流流量服务</p>
      </div>
    </div>
    <div class="p1">特色功能</div>
    <div class="tobt">
      <div align="center">
        <span class="iconfont icon-shipin1"></span>
        <p>视频交友</p>
      </div>
      <div align="center">
        <span class="iconfont icon-duanxinyingxiao-duanxinguanhuai"></span>
        <p>免流流量服务</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      cun_list: [],
      icons_list: []
    };
  },
  created() {
    this.axios
      .get(
        "https://www.easy-mock.com/mock/5d22b07122209809144c8ca2/example/id=2"
      )
      .then(res => {
        this.cun_list.push(
          res.data.data.register[0],
          res.data.data.register[1],
          res.data.data.register[2]
        );
      });
    this.axios
      .get(
        "https://www.easy-mock.com/mock/5d22b07122209809144c8ca2/example/icon"
      )
      .then(res => {
        this.icons_list = res.data.data.register;
        // console.log(this.icons_list)
      });
  },
  methods: {
    icon(e) {
      return e;
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less">
.hello {
  margin-bottom: 3.8rem;
  .tobt {
    width: 100%;
    display: flex;
    background-color: #fff;
    height: 5rem;
    div {
      width: 20%;
      span {
        display: inline-block;
        font-size: 1.7rem;
        margin-top: 1rem;
      }
      p {
        margin-top: 0.3rem;
        font-size: 0.7rem;
      }
    }
  }
  .p1 {
    font-size: 0.8rem;
    color: rgb(146, 142, 142);
    margin-top: 0.4rem;
    margin-left: 0.5rem;
  }
  .toolbox {
    width: 100%;
    height: 20rem;
    background-color: #fff;
    margin-top: 1rem;
    .tool {
      display: flex;
      flex-wrap: wrap;
      div {
        flex-basis: 25%;
        height: 5rem;
        span {
          display: inline-block;
          font-size: 1.7rem;
          margin-top: 1rem;
        }
        p {
          margin-top: 0.3rem;
          font-size: 0.7rem;
        }
      }
    }
  }
  .yingnew {
    width: 100%;
    background-color: #fff;
    height: 3rem;
    margin-top: 0.7rem;
    .headr {
      float: right;
      margin-top: 0.8rem;
      width: 9.5rem;
      img {
        width: 1rem;
        float: left;
        margin-right: 0.3rem;
        height: 1rem;
      }
      span {
        font-size: 0.8rem;
        color: rgba(126, 126, 123, 0.493);
      }
    }
    .headl {
      span:nth-child(1) {
        color: black;
        font-size: 1rem;
        font-weight: 600;
      }
      span {
        margin-top: 0.8rem;
        float: left;
        margin-left: 1rem;
      }
      span:nth-child(2) {
        display: inline-block;
        font-size: 0.9rem;
        color: #fff;
        width: 1rem;
        height: 1rem;
        text-align: center;
        line-height: 1rem;
        border-radius: 50%;
        background-color: red;
        margin-left: 0.3rem;
        margin-top: 0.9rem;
      }
    }
  }
  .header {
    width: 100%;
    height: 3rem;
    background-color: #fff;
    .headl {
      line-height: 3rem;
      span {
        margin-left: 0.5rem;
        float: left;
        span:nth-child(1) {
          margin-left: 1rem;
        }
        span:nth-child(2) {
          color: black;
          font-size: 0.7rem;
        }
      }
    }
    .headr {
      float: right;
      line-height: 3rem;
      margin-right: 1rem;
    }
  }
}
</style>

